/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package entity;

import org.hibernate.Criteria;
import org.orm.PersistentException;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class UtenteCriteria extends AbstractORMCriteria {
	public final IntegerExpression ID;
	public final StringExpression username;
	public final StringExpression password;
	public final StringExpression avatar;
	public final StringExpression nickname;
	public final StringExpression nome;
	public final StringExpression cognome;
	public final LongExpression data_nascita;
	public final StringExpression classe_utenza;
	public final StringExpression citta;
	public final StringExpression indirizzo;
	public final StringExpression outgoing_mail_server;
	public final StringExpression incoming_mail_serve;
	public final IntegerExpression outgoing_port;
	public final IntegerExpression incoming_port;
	
	public UtenteCriteria(Criteria criteria) {
		super(criteria);
		ID = new IntegerExpression("ID", this);
		username = new StringExpression("username", this);
		password = new StringExpression("password", this);
		avatar = new StringExpression("avatar", this);
		nickname = new StringExpression("nickname", this);
		nome = new StringExpression("nome", this);
		cognome = new StringExpression("cognome", this);
		data_nascita = new LongExpression("data_nascita", this);
		classe_utenza = new StringExpression("classe_utenza", this);
		citta = new StringExpression("citta", this);
		indirizzo = new StringExpression("indirizzo", this);
		outgoing_mail_server = new StringExpression("outgoing_mail_server", this);
		incoming_mail_serve = new StringExpression("incoming_mail_serve", this);
		outgoing_port = new IntegerExpression("outgoing_port", this);
		incoming_port = new IntegerExpression("incoming_port", this);
	}
	
	public UtenteCriteria(PersistentSession session) {
		this(session.createCriteria(Utente.class));
	}
	
	public UtenteCriteria() throws PersistentException {
		this(entity.CaranonnaPersistentManager.instance().getSession());
	}
	
	public ContattoCriteria createContattoCriteria() {
		return new ContattoCriteria(createCriteria("ORM_Contatto"));
	}
	
	public MessaggioCriteria createMessaggioCriteria() {
		return new MessaggioCriteria(createCriteria("ORM_Messaggio"));
	}
	
	public Utente uniqueUtente() {
		return (Utente) super.uniqueResult();
	}
	
	public Utente[] listUtente() {
		java.util.List list = super.list();
		return (Utente[]) list.toArray(new Utente[list.size()]);
	}
}

